<?php
class Usr001 extends Controller {

    function Usr001() {
        parent::Controller();
    }

    function index() {
        /* Load Lib */
        
        //$this->load->database();
        //$this->load->helper('url');
        //$this->load->library('pagination');

        $blog_config = $this->config->item('uap_config');
        $site_name = $blog_config['site_name'];


        /* Config Data */
        $config['base_url'] = base_url().'usr001/index/';
        $config['total_rows'] = $this->db->count_all('uap_mst_user');
        $config['per_page'] = '20';
        $config['full_tag_open'] = '<div class="pagination"><ul>';
        $config['full_tag_close'] = '</ul></div>';

        // Customizing the First Link
        $config['first_link'] = 'First';
        $config['first_tag_open'] = '<li>';
        $config['first_tag_close'] = '</li>';

        // Customizing the Last Link
        $config['last_link'] = 'Last';
        $config['last_tag_open'] = '<li>';
        $config['last_tag_close'] = '</li>';

        // Customizing the "Next" Link
        $config['next_link'] = '&gt;';
        $config['next_tag_open'] = '<li>';
        $config['next_tag_close'] = '</li>';

        // Customizing the "Previous" Link
        $config['prev_link'] = '&lt;';
        $config['prev_tag_open'] = '<li>';
        $config['prev_tag_close'] = '</li>';

        // Customizing the "Current Page" Link
        $config['cur_tag_open'] = '<li><a href="#" class="currentpage"><strong>';
        $config['cur_tag_close'] = '</a></span></li>';

        // Customizing the "Digit" Link
        $config['num_tag_open'] = '<li>';
        $config['num_tag_close'] = '</li>';

        $this->pagination->initialize($config);

        /* load the model and get results*/
        $this->load->model('user_model');
        $data['results'] = $this->user_model->get_user($config['per_page'],$this->uri->segment(3));
        $data['num_rows'] = $config['total_rows'];

        $blog_config = $this->config->item('uap_config');

        $data['site_name'] = $blog_config['site_name'];
        /* load the HTML Table Class */
        $this->load->library('table');
        $this->table->set_heading('ID', 'Title', 'Author', 'Description');

        // Load Header
        $this->load->view('themes/header', $data);

        // load the view
        $this->load->view('usr001_view', $data);
        // load footer
        $this->load->view('themes/footer');
    }
}
?>
